#ifndef _FENGINE_GUINODE
#define _FENGINE_GUINODE

#include <list>
#include <string>
#include "FEngineType.h"

namespace FEngine
{
	/**
	 * A GUINode is an element of the graphical user interface.
	 * Each GUINode has one parent GUINode and can have a unlimited number of child.
	 */
	class GUINode
	{
		private:

			GUINode*			mParentNode;
			std::list<GUINode*>	mChildNodeList;
	

		protected:

			Vector2				mPosition;


		public:
			
			/**
			 * Constructor.
			 */
			GUINode();
			virtual ~GUINode();
			
			/**
			 * Add another GUINode to the list of child of this GUINode.
			 * @param _node Child node to add.
			 */
			void addChild(GUINode* _node);
			
			/**
			 * Remove one of the child GUINode from the list of child of this node.
			 * @param _node Child node to remove.
			 */
			void removeChild(GUINode* _node);
			
			/**
			 * Update the logic of the GUINode.
			 * Called every frame.
			 * @param _elpsedTime Time elapsed since the last frame.
			 */
			virtual void update(double _elapsedTime);

			/**
			 * Send the render data of the GUINode to directX.
			 * Called every frame.
			 * @param _elpsedTime Time elapsed since the last frame.
			 */
			virtual void render(double _elapsedTime);

			/**
			 * Return the parent Node to wich is attached the Node.
			 * @return Parent Node or NULL if the Node has no parent.
			 */
			inline GUINode* getParentNode() const
			{
				return mParentNode;
			}

			void _setParentNode(GUINode* _node);

			/**
			 * Return the position of the GUINode.
			 * @return Vector2 containing the position of the GUINode.
			 */
			inline Vector2 getPosition() const
			{
				return mPosition;
			}

			/**
			 * Set the position of the GUINode.
			 * @param _pos Vector2 containing the position of the GUINode.
			 */
			void setPosition(const Vector2& _pos);

			/**
			 * Set the position of the GUINode.
			 * @param _x Position of the GUINode on the X axis.
			 * @param _y Position of the GUINode on the Y axis.
			 */
			void setPosition(float _x, float _y);
			
			/**
			 * Translate the position of the GUINode.
			 * @param _pos Vector2 containing the translation value.
			 */
			void translate(const Vector2& _pos);

			/**
			 * Translate the position of the GUINode.
			 * @param _x Translation of the Node on the X axis.
			 * @param _y Translation of the Node on the Y axis.
			 */
			void translate(float _x, float _y);
			

		private:

			GUINode(GUINode const&);
			void operator=(GUINode const&);

	};

} // namespace FEngine

#endif
